﻿using UnityEngine;
using System.Collections;
using Slate;
using XSlate.Runtime;
#if UNITY_EDITOR
using Sirenix.OdinInspector;
#endif
namespace XSlate {
    public abstract class XStateActionBase : ActionClip
    {
        [SerializeField]
        [HideInInspector]
        private float durtion;

        public override float length { get => this.durtion; set => this.durtion = value; }


        public override string info {
            get {
                if (string.IsNullOrEmpty(ActionName)) {
                    var nameAtt = this.GetType().RTGetAttribute<NameAttribute>(true);
                    if (nameAtt != null) {
                        return nameAtt.name;
                    }
                    return this.GetType().Name.SplitCamelCase();
                }

                return ActionName;
            }
        }

        [LabelText("Action名称")]
        public string ActionName;

        [BoxGroup("绑定数据",CenterLabel = true)]
        [HideLabel]
        public XDirectableData BindingDate;

    }
}